
import { parseHTML } from "./html-parser.js";

// parseHTML函数--也就是将模板编译成一个AST树
const html = `

<div class="main-container">
    <div class="table">
        <div class="row-container" v-for="item in list" :key="item">
            <div class="unit-container">{{item.name}}</div>
            <div class="unit-container">{{item.age}}</div>
            <div class="unit-container">{{item.score}}</div>
        </div>
    </div>
</div>

`

console.log(parseHTML);

const ast = parseHTML(html,{
    start(tag,attrs,unary) {
        console.log("start",tag,attrs,unary);
    },
    end() {
        console.log("end");
    },
    chars(text) {
        console.log("text");
    },
    comment(text) {
        console.log("comment" + text);
    }
});
console.log(ast);


